{% extends "crm/sub_page/base.html" %}
{% block content %}
    <div class="col-sm-6">
    {% if course_records %}
        <section class="panel">
          <header class="panel-heading no-border">
              {{ course_records.0.class_name }}
          </header>
          <table class="table table-bordered">
              <thead>
              <tr>
                  <th>#</th>
                  <th>课程名</th>
                  <th>课时名</th>
                  <th>上课时间</th>
                  <th>状态</th>
                  <th>操作</th>
              </tr>
              </thead>
              <tbody>
              {% for i in course_records %}
              <tr>
                  <td>{{ forloop.counter }}</td>
                  <td>{{ i.class_name.course.name }}</td>
                  <td>{{ i.course_content.name }}</td>
                  <td>{{ i.date }}</td>
                  <td>
                      {% if course_records.date %}
                          <span class="label label-default">已结束</span>
                      {% else %}
                          <span class="label label-primary">未开始</span>
                      {% endif %}
                  </td>
                  <td>
                      <!-- Button trigger modal -->
                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal" href="/apis/course_record/{{ i.id }}">
                          详
                        </button>
                  </td>
              </tr>
              {% endfor %}
              </tbody>
          </table>
        </section>
    {% else %}
        "您暂时没有报名任何课程，点......查看...."
    {% endif %}
    </div>

    <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...hello world123123
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
{% endblock %}
